
/**
 * Copyright (c) 2006
 *      OpenAVS Developers. All Rights Reserved.
 *
 * Copyright (c) 2005-2006
 *      NSCC. All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef _LOOPFILTER_H_
#define _LOOPFILTER_H_
#include "define.h"

//const table ------------------------------------
static const BYTE ALPHA_TABLE[64] = 
{
   0,  0,  0,  0,  0,  0,  1,  1,
   1,  1,  1,  2,  2,  2,  3,  3,
   4,  4,  5,  5,  6,  7,  8,  9,
  10, 11, 12, 13, 15, 16, 18, 20,
  22, 24, 26, 28, 30, 33, 33, 35,
  35, 36, 37, 37, 39, 39, 42, 44,
  46, 48, 50, 52, 53, 54, 55, 56,
  57, 58, 59, 60, 61, 62, 63, 64
};

static const BYTE BETA_TABLE[64] = 
{
   0,  0,  0,  0,  0,  0,  1,  1,
   1,  1,  1,  1,  1,  2,  2,  2,
   2,  2,  3,  3,  3,  3,  4,  4,
   4,  4,  5,  5,  5,  5,  6,  6,
   6,  7,  7,  7,  8,  8,  8,  9,
   9, 10, 10, 11, 11, 12, 13, 14,
  15, 16, 17, 18, 19, 20, 21, 22,
  23, 23, 24, 24, 25, 25, 26, 27
};

static const BYTE CLIP_TABLE[64] = 
{
  0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0,
  1, 1, 1, 1, 1, 1, 1, 1, 
  1, 1, 1, 1, 1, 1, 2, 2,
  2, 2, 2, 2, 2, 2, 3, 3,
  3, 3, 3, 3, 3, 4, 4, 4,
  5, 5, 5, 6, 6, 6, 7, 7,
  7, 7, 8, 8, 8, 9, 9, 9
};

void DeblockOneMacroBlock(
		MBINFO * pMbInfo, 
		AVS_DWORD dwMbIndex, 
		AVS_DWORD dwMbWidth, 
		STREAMINFO * pStrmInfo, 
		VIDEODATA * pCurrVD);

#endif

